package dao.impl;

import com.google.common.collect.ImmutableMap;
import dao.ApplyConditionDao;
import domain.ApplyCondition;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by aceyin on 15/6/26.
 */
@Repository
public class ApplyConditionDaoImpl extends BaseGenericDao<ApplyCondition, Integer> implements ApplyConditionDao {
    @Override
    public ApplyCondition getByRecruitmentId(long id) {
        Map<String, Object> param = ImmutableMap.<String, Object>builder().put("recruitment_id", id).build();
        return queryOne("get-by-recruitment-id", param);
    }

    @Override
    public List<ApplyCondition> findByRecruitmentIds(List<Long> ids) {
        Map<String, Object> params = newMapBuilder().put("ids", ids).build();
        return queryList("find-by-recruitment-id", params);
    }
}
